package org.linlinjava.litemall.db.vo.shop;

import org.linlinjava.litemall.db.domain.AgedmallHospitalSendSelfLocation;


import java.util.ArrayList;
import java.util.List;

/**
 * @author wj
 * @date 2022/1/18 15:05
 */
public class HospitalSelfLocationVo {

    private Long id;


    private String locationName;

    private String startHour;

    private String endHour;

    private String remark;

    private String imgs;


    private Integer hpFlag;


    private Integer inventoryFlag;


    private Integer freeFlag;

    private String adminPhone;

    //如果为医院库存
    private List<HospitalSelfLocationEquVo> hospitalSelfLocationEquList;

    public List<HospitalSelfLocationEquVo> getHospitalSelfLocationEquList() {
        return hospitalSelfLocationEquList;
    }

    public void setHospitalSelfLocationEquList(List<HospitalSelfLocationEquVo> hospitalSelfLocationEquList) {
        this.hospitalSelfLocationEquList = hospitalSelfLocationEquList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getStartHour() {
        return startHour;
    }

    public void setStartHour(String startHour) {
        this.startHour = startHour;
    }

    public String getEndHour() {
        return endHour;
    }

    public void setEndHour(String endHour) {
        this.endHour = endHour;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public Integer getHpFlag() {
        return hpFlag;
    }

    public void setHpFlag(Integer hpFlag) {
        this.hpFlag = hpFlag;
    }

    public Integer getInventoryFlag() {
        return inventoryFlag;
    }

    public void setInventoryFlag(Integer inventoryFlag) {
        this.inventoryFlag = inventoryFlag;
    }

    public Integer getFreeFlag() {
        return freeFlag;
    }

    public void setFreeFlag(Integer freeFlag) {
        this.freeFlag = freeFlag;
    }

    public String getAdminPhone() {
        return adminPhone;
    }

    public void setAdminPhone(String adminPhone) {
        this.adminPhone = adminPhone;
    }

    public static AgedmallHospitalSendSelfLocation toHospitalSelfLocation(HospitalSelfLocationVo hospitalSelfLocationVo,Long hospitalId){
        AgedmallHospitalSendSelfLocation hospitalSendSelfLocation=new AgedmallHospitalSendSelfLocation();
        hospitalSendSelfLocation.setId(hospitalSelfLocationVo.getId());
        hospitalSendSelfLocation.setHospitalId(hospitalId);
        hospitalSendSelfLocation.setSelfLocationName(hospitalSelfLocationVo.getLocationName());
        hospitalSendSelfLocation.setBusinessStartHour(hospitalSelfLocationVo.getStartHour());
        hospitalSendSelfLocation.setBusinessEndHour(hospitalSelfLocationVo.getEndHour());
        hospitalSendSelfLocation.setLocationRemark(hospitalSelfLocationVo.getRemark());
        hospitalSendSelfLocation.setLocationImgs(hospitalSelfLocationVo.getImgs());
        hospitalSendSelfLocation.setHpFlag(hospitalSelfLocationVo.getHpFlag());
        hospitalSendSelfLocation.setInventoryFlag(hospitalSelfLocationVo.getInventoryFlag());
        hospitalSendSelfLocation.setFreeFlag(hospitalSelfLocationVo.getFreeFlag());
        hospitalSendSelfLocation.setAdminPhone(hospitalSelfLocationVo.getAdminPhone());
        return hospitalSendSelfLocation;
    }

    public HospitalSelfLocationVo(Long id, String locationName, String startHour, String endHour, String remark, String imgs, Integer hpFlag, Integer inventoryFlag, Integer freeFlag, String adminPhone, List<HospitalSelfLocationEquVo> hospitalSelfLocationEquList) {
        this.id = id;
        this.locationName = locationName;
        this.startHour = startHour;
        this.endHour = endHour;
        this.remark = remark;
        this.imgs = imgs;
        this.hpFlag = hpFlag;
        this.inventoryFlag = inventoryFlag;
        this.freeFlag = freeFlag;
        this.adminPhone = adminPhone;
        this.hospitalSelfLocationEquList = hospitalSelfLocationEquList;
    }

    public HospitalSelfLocationVo() {
    }

    public HospitalSelfLocationVo(AgedmallHospitalSendSelfLocation selfLocation) {
        this.id = selfLocation.getId();
        this.locationName = selfLocation.getSelfLocationName();
        this.startHour = selfLocation.getBusinessStartHour();
        this.endHour = selfLocation.getBusinessEndHour();
        this.remark = selfLocation.getLocationRemark();
        this.imgs = selfLocation.getLocationImgs();
        this.hpFlag = selfLocation.getHpFlag();
        this.inventoryFlag = selfLocation.getInventoryFlag();
        this.freeFlag = selfLocation.getFreeFlag();
        this.adminPhone = selfLocation.getAdminPhone();
    }

    public static List<HospitalSelfLocationVo> toSelfLocationVo(List<AgedmallHospitalSendSelfLocation> selfLocationList){
        List<HospitalSelfLocationVo> selfLocationVoList=new ArrayList<>();
        for (int i = 0; i < selfLocationList.size(); i++) {
            HospitalSelfLocationVo locationVo=new HospitalSelfLocationVo(selfLocationList.get(i));
            selfLocationVoList.add(locationVo);
        }
        return selfLocationVoList;
    }
}
